/*     */ package com.qmsk.business.member.memberRecharge.controller;
/*     */ 
/*     */ import com.qmsk.business.member.memberRecharge.dao.MemberRechargeDao;
/*     */ import com.utils.basic.MapUtils;
/*     */ import com.utils.gson.out.GsonEbRst;
/*     */ import com.utils.web.RequestUtils;
/*     */ import com.utils.web.ResponseUtils;
/*     */ import java.sql.SQLException;
/*     */ import java.util.Date;
/*     */ import java.util.HashMap;
/*     */ import java.util.Map;
/*     */ import javax.servlet.http.HttpServletRequest;
/*     */ import javax.servlet.http.HttpServletResponse;
/*     */ import org.apache.log4j.Logger;
/*     */ import org.springframework.beans.factory.annotation.Autowired;
/*     */ import org.springframework.stereotype.Controller;
/*     */ import org.springframework.web.bind.annotation.PathVariable;
/*     */ import org.springframework.web.bind.annotation.RequestMapping;
/*     */ 
/*     */ @Controller
/*     */ @RequestMapping({"memberRecharge"})
/*     */ public class MemberRechargeController
/*     */ {
/*  29 */   private static final Logger logger = Logger.getLogger(MemberRechargeController.class);
/*     */ 
/*     */   @Autowired
/*     */   private MemberRechargeDao dao;
/*     */ 
/*     */   @RequestMapping(value={"find/shopId/{shopId}/opt/{pageIdx}/{pageSize}"}, method={org.springframework.web.bind.annotation.RequestMethod.GET})
/*     */   public void getListShopId(HttpServletRequest request, HttpServletResponse response, @PathVariable("shopId") String shopId, @PathVariable("pageIdx") Integer nPageIdx, @PathVariable("pageSize") Short nPageSize)
/*     */   {
/*  49 */     nPageSize = RequestUtils.getRequestValidPageSize(nPageSize);
/*     */     try {
/*  51 */       Map params = new HashMap();
/*  52 */       MapUtils.addToMap(params, "mp", 
/*  53 */         RequestUtils.getString(request, "mp"));
/*  54 */       MapUtils.addPercentToMap(params, "name", 
/*  55 */         RequestUtils.getString(request, "name"));
/*  56 */       MapUtils.addToMap(params, "cardNo", 
/*  57 */         RequestUtils.getString(request, "cardNo"));
/*  58 */       MapUtils.addToMap(params, "dtStart", 
/*  59 */         RequestUtils.getDate(request, "dtStart"));
/*  60 */       MapUtils.addToMap(params, "dtEnd", 
/*  61 */         RequestUtils.getDate(request, "dtEnd"));
/*  62 */       MapUtils.addToMap(params, "levelId", 
/*  63 */         RequestUtils.getInt(request, "levelId"));
/*  64 */       MapUtils.addToMap(params, "cardStatus", 
/*  65 */         RequestUtils.getInt(request, "cardStatus"));
/*     */ 
/*  67 */       getAddBirthDay(params, request);
/*     */ 
/*  69 */       GsonEbRst gsonEbRst = this.dao.getGsonOfShopId(params, nPageIdx, 
/*  70 */         nPageSize);
/*  71 */       ResponseUtils.setResponseResult(gsonEbRst, response);
/*     */     } catch (SQLException e) {
/*  73 */       logger.error(e);
/*  74 */       ResponseUtils.setErrorMsgResponse(
/*  75 */         RequestUtils.getFindDataErrorMessage(request), response);
/*     */     }
/*     */   }
/*     */ 
/*     */   private void getAddBirthDay(Map<String, Object> params, HttpServletRequest request)
/*     */   {
/*  81 */     Date date = RequestUtils.getDate(request, "birthDay");
/*  82 */     if (date == null) {
/*  83 */       return;
/*     */     }
/*  85 */     MapUtils.addToMap(params, "birthDayStart", new Date(date.getTime() - 86400000L));
/*     */ 
/*  87 */     MapUtils.addToMap(params, "birthDayEnd", new Date(date.getTime() + 86400000L));
/*     */   }
/*     */ 
/*     */   @RequestMapping(value={"find/shopId/{shopId}/opt/sum"}, method={org.springframework.web.bind.annotation.RequestMethod.GET})
/*     */   public void getListShopIdSum(HttpServletRequest request, HttpServletResponse response, @PathVariable("shopId") String shopId)
/*     */   {
/*     */     try
/*     */     {
/* 104 */       Map params = new HashMap();
/* 105 */       MapUtils.addToMap(params, "mp", 
/* 106 */         RequestUtils.getString(request, "mp"));
/* 107 */       MapUtils.addPercentToMap(params, "name", 
/* 108 */         RequestUtils.getString(request, "name"));
/* 109 */       MapUtils.addToMap(params, "cardNo", 
/* 110 */         RequestUtils.getString(request, "cardNo"));
/* 111 */       MapUtils.addToMap(params, "dtStart", 
/* 112 */         RequestUtils.getDate(request, "dtStart"));
/* 113 */       MapUtils.addToMap(params, "dtEnd", 
/* 114 */         RequestUtils.getDate(request, "dtEnd"));
/* 115 */       MapUtils.addToMap(params, "levelId", 
/* 116 */         RequestUtils.getInt(request, "levelId"));
/* 117 */       MapUtils.addToMap(params, "cardStatus", 
/* 118 */         RequestUtils.getInt(request, "cardStatus"));
/*     */ 
/* 120 */       getAddBirthDay(params, request);
/*     */ 
/* 122 */       GsonEbRst gsonEbRst = this.dao.getGsonOfShopIdSum(params);
/* 123 */       ResponseUtils.setResponseResult(gsonEbRst, response);
/*     */     } catch (SQLException e) {
/* 125 */       logger.error(e);
/* 126 */       ResponseUtils.setErrorMsgResponse(
/* 127 */         RequestUtils.getFindDataErrorMessage(request), response);
/*     */     }
/*     */   }
/*     */ }

/* Location:           C:\Users\Administrator\Desktop\新建文件夹\WEB-INF\classes\
 * Qualified Name:     com.qmsk.business.member.memberRecharge.controller.MemberRechargeController
 * JD-Core Version:    0.5.3
 */